package com.ssm.service;

import com.ssm.Entity.Dept;
import com.ssm.Entity.Emp;
import com.ssm.dao.EmpDAOImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class EmpService {

    @Autowired
    private EmpDAOImpl empDAO;


    public List<Emp> selectAllEmp(){
        return empDAO.selectEmp();
    }

    public List<Dept> selectAllDept() {
        return empDAO.selectDept();
    }

    public List<Emp> findEmpByDeptId(int deptId) {
        return empDAO.findEmpByDeptId(deptId);
    }

    public int addEmp(Emp emp) {
        return empDAO.addEmp(emp);
    }

    public int addDept(Dept dept) {
        return empDAO.addDept(dept);
    }
}
